<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/sql/kernel/qsqlindex.cpp -->
<head>
  <title>Qt 4.3: QSqlIndex Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QSqlIndex Class Reference<br /><sup><sup>[<a href="qtsql.html">QtSql</a> module]</sup></sup></h1>
<p>The QSqlIndex class provides functions to manipulate and describe database indexes. <a href="#details">More...</a></p>
<pre> #include &lt;QSqlIndex&gt;</pre><p>Inherits <a href="qsqlrecord.html">QSqlRecord</a>.</p>
<ul>
<li><a href="qsqlindex-members.html">List of all members, including inherited members</a></li>
<li><a href="qsqlindex-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qsqlindex.html#QSqlIndex">QSqlIndex</a></b> ( const QString &amp; <i>cursorname</i> = QString(), const QString &amp; <i>name</i> = QString() )</li>
<li><div class="fn"/><b><a href="qsqlindex.html#QSqlIndex-2">QSqlIndex</a></b> ( const QSqlIndex &amp; <i>other</i> )</li>
<li><div class="fn"/><b><a href="qsqlindex.html#dtor.QSqlIndex">~QSqlIndex</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#append">append</a></b> ( const QSqlField &amp; <i>field</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#append-2">append</a></b> ( const QSqlField &amp; <i>field</i>, bool <i>desc</i> )</li>
<li><div class="fn"/>QString <b><a href="qsqlindex.html#cursorName">cursorName</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qsqlindex.html#isDescending">isDescending</a></b> ( int <i>i</i> ) const</li>
<li><div class="fn"/>QString <b><a href="qsqlindex.html#name">name</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setCursorName">setCursorName</a></b> ( const QString &amp; <i>cursorName</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setDescending">setDescending</a></b> ( int <i>i</i>, bool <i>desc</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setName">setName</a></b> ( const QString &amp; <i>name</i> )</li>
<li><div class="fn"/>QSqlIndex &amp; <b><a href="qsqlindex.html#operator-eq">operator=</a></b> ( const QSqlIndex &amp; <i>other</i> )</li>
</ul>
<ul>
<li><div class="fn"/>28 public functions inherited from <a href="qsqlrecord.html#public-functions">QSqlRecord</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QSqlIndex class provides functions to manipulate and describe database indexes.</p>
<p>An <i>index</i> refers to a single table or view in a database. Information about the fields that comprise the index can be used to generate SQL statements, or to affect the behavior of a <a href="porting4.html#qsqlcursor">QSqlCursor</a> object.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QSqlIndex"></a>QSqlIndex::QSqlIndex ( const <a href="qstring.html">QString</a> &amp; <i>cursorname</i> = QString(), const <a href="qstring.html">QString</a> &amp; <i>name</i> = QString() )</h3>
<p>Constructs an empty index using the cursor name <i>cursorname</i> and index name <i>name</i>.</p>
<h3 class="fn"><a name="QSqlIndex-2"></a>QSqlIndex::QSqlIndex ( const QSqlIndex &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<h3 class="fn"><a name="dtor.QSqlIndex"></a>QSqlIndex::~QSqlIndex ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<h3 class="fn"><a name="append"></a>void QSqlIndex::append ( const <a href="qsqlfield.html">QSqlField</a> &amp; <i>field</i> )</h3>
<p>Appends the field <i>field</i> to the list of indexed fields. The field is appended with an ascending sort order.</p>
<h3 class="fn"><a name="append-2"></a>void QSqlIndex::append ( const <a href="qsqlfield.html">QSqlField</a> &amp; <i>field</i>, bool <i>desc</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Appends the field <i>field</i> to the list of indexed fields. The field is appended with an ascending sort order, unless <i>desc</i> is true.</p>
<h3 class="fn"><a name="cursorName"></a><a href="qstring.html">QString</a> QSqlIndex::cursorName () const</h3>
<p>Returns the name of the cursor which the index is associated with.</p>
<p>See also <a href="qsqlindex.html#setCursorName">setCursorName</a>().</p>
<h3 class="fn"><a name="isDescending"></a>bool QSqlIndex::isDescending ( int <i>i</i> ) const</h3>
<p>Returns true if field <i>i</i> in the index is sorted in descending order; otherwise returns false.</p>
<h3 class="fn"><a name="name"></a><a href="qstring.html">QString</a> QSqlIndex::name () const</h3>
<p>Returns the name of the index.</p>
<p>See also <a href="qsqlindex.html#setName">setName</a>().</p>
<h3 class="fn"><a name="setCursorName"></a>void QSqlIndex::setCursorName ( const <a href="qstring.html">QString</a> &amp; <i>cursorName</i> )</h3>
<p>Sets the name of the cursor that the index is associated with to <i>cursorName</i>.</p>
<p>See also <a href="qsqlindex.html#cursorName">cursorName</a>().</p>
<h3 class="fn"><a name="setDescending"></a>void QSqlIndex::setDescending ( int <i>i</i>, bool <i>desc</i> )</h3>
<p>If <i>desc</i> is true, field <i>i</i> is sorted in descending order. Otherwise, field <i>i</i> is sorted in ascending order (the default). If the field does not exist, nothing happens.</p>
<p>See also <a href="qsqlindex.html#isDescending">isDescending</a>().</p>
<h3 class="fn"><a name="setName"></a>void QSqlIndex::setName ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
<p>Sets the name of the index to <i>name</i>.</p>
<p>See also <a href="qsqlindex.html#name">name</a>().</p>
<h3 class="fn"><a name="operator-eq"></a>QSqlIndex &amp; QSqlIndex::operator= ( const QSqlIndex &amp; <i>other</i> )</h3>
<p>Sets the index equal to <i>other</i>.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
